package com.jeect;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.session.data.redis.RedisFlushMode;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

@SpringBootApplication
@EnableDiscoveryClient
@EnableEurekaClient
@EnableRedisHttpSession(redisFlushMode = RedisFlushMode.IMMEDIATE)
@EnableZuulProxy
public class ZuulsessionApplication {

    public static void main(String[] args) {
        SpringApplication.run(ZuulsessionApplication.class, args);
    }

//    @Bean
//    public CorsFilter corsFilter() {
//        final UrlBasedConfigurationSource source = new UrlBasedConfigurationSource();
//        final CprsCpmfogiration configuration = new CorsConfiguration();
//        configuration.setAllowCredentials(true);
//        configuration.setAllowedOrigins(new ArrayList<String>() {{
//            add("*");
//        }});
//        configuration.setAllowedHeaders(new ArrayList<String>() {{
//            add("*");
//        }});
//        configuration.setAllowedMethods(new ArrayList<String>() {{
//            add("*");
//        }});
//        source.registerCorsConfiguration("/**", configuration);
//        return new CorsFilter(source);
//    }
}

